<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>111</div>
    <div>222</div>
    <ul id="ulbox">
        <li>aaa</li>
        <li>aaa</li>
        <li>aaa</li>
    </ul>
    <ol>
        <li>bbb</li>
        <li>bbb</li>
        <li>bbb</li>
    </ol>

    <script>
        var divboxs=document.getElementsByTagName("div");
        console.log(divboxs);//获取的元素会存放到 集合(类数组)
        divboxs[0].style.color="red";

        var lis=document.getElementsByTagName("li");
        console.log(lis);

        var ulbox=document.getElementById("ulbox");
        var ullis=ulbox.getElementsByTagName("li");
        console.log(ullis);
    </script>
</body>
</html>